package com.tianji.aigc.controller;


import com.tianji.aigc.service.IChatSessionService;
import com.tianji.aigc.vo.SessionVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 对话session 前端控制器
 * </p>
 *
 * @author fzk
 * @since 2025-09-02
 */
@RestController
@RequestMapping("/session")
@RequiredArgsConstructor
public class ChatSessionController {

    private final IChatSessionService chatSessionService;

    /**
     * 新建会话
     */
    @PostMapping
    public SessionVO createSession(@RequestParam(value = "n", defaultValue = "3") Integer number) {
        return chatSessionService.createSession(number);
    }

    /**
     * 获取随机热点
     */
    @GetMapping("/hot")
    public List<SessionVO.Example> hotExampleList(@RequestParam(value = "n", defaultValue = "3") Integer number){
        return chatSessionService.getHotExampleList(number);
    }

}
